/*
 * @Description: 档案导出管理主页面
 * @Author: Rfan
 * @Date: 2022-06-21 21:37:30
 * @LastEditTime: 2022-06-23 18:24:31
 */

import classNames from 'classnames/bind';
import { ExportMgtRouterTypeContext } from './contexts/ExportMgtRouterTypeContext';
import { ExportMgtContextProvider } from './contexts/ExportMgtContext';
import PageWrap from './components/PageWrap';
import MainTitle from './components/MainTitle';
import PageSidebar from './components/PageSidebar';
import { EnumExportBusType } from '@/dictionary/transfer';
import styles from './styles/exportMgtMain.module.scss';

const cx = classNames.bind(styles);

interface IExportMgtProps {
  type?: EnumExportBusType;
  title?: string;
}

export const ExportMgtMainPage = (props: IExportMgtProps) => {
  const { type = EnumExportBusType.Export, title = '档案导出' } = props;

  return (
    <ExportMgtRouterTypeContext.Provider value={{ type, title }}>
      <ExportMgtContextProvider>
        <div className={cx('export-mgt-main')}>
          <div className={cx('nav-wrap')}>
            <PageSidebar />
          </div>
          <div className={cx('page-wrap')}>
            <MainTitle />
            <PageWrap />
          </div>
        </div>
      </ExportMgtContextProvider>
    </ExportMgtRouterTypeContext.Provider>
  );
};

const ExportMgtMain = () => <ExportMgtMainPage />;
export default ExportMgtMain;
